package com.socket;

/**
 * @author 大忽悠
 * @create 2023/1/11 21:45
 */
public class Result {
    private int code;
    private Object data;

    public Result(int code, Object data) {
        this.code = code;
        this.data = data;
    }

    public static Result success(Object data){
        return new Result(200,data);
    }

    public static Result error(Object err){
        return new Result(500,err);
    }

    public static Result success() {
       return success("响应成功");
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
